<?php

/*

  Treasure	$3 + 1 potion

  When you play this, count your deck and discard pile.
  Worth $1 per 5 cards total between them (rounded down).

 */

class PhilosophersStone extends Card implements iTreasure, iKingdom, iAlchemy {

    public function __construct() {
        $price = new Price(3, 1);
        parent::__construct("Philosophers Stone", $price);
        $this->undoPlay = false;
        $this->undoBuy = true;
    }

    public function getDescription() {
        return array(
            "When you play this, count your deck and discard pile. Worth $1 per 5 cards total between them (rounded down).");
    }
    
    public function autoPlayNum(Game $game) {
        return 5;
    }

    public function getMoneyValue(Game $game) {
        $num = $game->getDiscardDeckSize() + $game->getDrawDeckSize();
        $num = floor($num / 5);
         ScreenDisplay::addScreenMessage($game, true, "get +$num$", "gets +$num$");
        return new Price($num);
    }
    
        public function boardSetup(Game $game) {
        $game->addPotion();
        return true;
    }

}

?>